<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html,
        body {
            height: 100%;
            background: linear-gradient(to right, #2BC0E4, #EAECC6);
        }
        
        .box1 {
            width: 200px;
            height: 200px;
            border: 5px solid gray;
            background: radial-gradient(red 0%, green 10%, blue);
            /* 
            默认 从中间开始
            百分比是控制过度
            background:radial-gradient(red 50%,blue 50%); 
            */
        }
        
        .box2 {
            width: 300px;
            height: 100px;
            border: 5px solid gray;
            margin-top: 10px;
            background: radial-gradient(circle, red, green, blue);
            /* 径向渐变设置形状
            circle 圆形
            ellipse 椭圆
            */
            /* 渐变中心点
            background:radial-gradient(60% 40%,red,green,blue);
            
            background:radial-gradient(60% 40%,closest-side,red,green,blue);
            closest-side  最近边  farthest-side   最远边 
            closest-corner最近角  farthest-corner 最远角
            
            background:-webkit-radial-gradient
            -webkit-加上之后兼容
            */
        }
    </style>
</head>

<body>
    <div class="box1"></div>
    <div class="box2"></div>
</body>

</html>